package com.boyadegroot.divelog.ui.diver;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;

import com.boyadegroot.divelog.R;
import com.boyadegroot.divelog.models.Diver;

public class DiverImportContainer extends FragmentActivity {

    private static final String TAG = DiverImportContainer.class.getName();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        Bundle args = intent.getExtras();
        Diver diver = args.getParcelable("diver");
        setContentView(R.layout.fragment_import_container);
        if (savedInstanceState != null) {
            return;
        }
        DiverImport fragment = DiverImport.newInstance(diver);
        fragment.setArguments(getIntent().getExtras());
        FragmentManager fm = getSupportFragmentManager();
        fm.beginTransaction()
                .add(R.id.layout, fragment)
                .commit();
    }
}
